<div id="ben-header">
	<div class="ben-language">
    	<a href="<?php echo HTTP_SERVER?>site/en/">English</a> <span>|</span> <a href="<?php echo HTTP_SERVER?>site/default/">Tiếng Việt</a> <span>|</span> <a href="<?php echo HTTP_SERVER?>site/<?php echo $this->member->getSiteId()?>/lienhe">Liên hệ</a>
    </div>
	<div class="ben-navigation">
    
            <ul id="ben-main-nav">
                <?php echo $mainmenu?>
            </ul>
    
            <div class="clearer">&nbsp;</div>
    
        </div>
	<div id="ben-header-searchform">
    	<h3><?php echo $this->document->text['timkiembatdongsan']?></h3>
        <table>
        	<tr>
            	<td width="80px"><?php echo $this->document->text['nhucau']?>:</td>
                <td>
                	<select id="nhucau" name="nhucau">
                    	<option value=""></option>
                        <?php foreach($m_nhucau as $val){ ?>
                        <option value="<?php echo $val['manhom']?>"><?php echo $this->string->getPrefix("&nbsp;&nbsp;&nbsp;&nbsp;",$val['level']-1)?><?php echo $val['tennhom']?></option>
                        <?php } ?>
                    </select>
                </td>
            </tr>
            <tr>
            	<td><?php echo $this->document->text['loaibds']?>:</td>
                <td>
                	<select id="loaibds" name="loaibds">
                        <option value=""></option>
                        <?php foreach($m_loaibds as $val){ ?>
                        <option value="<?php echo $val['manhom']?>"><?php echo $this->string->getPrefix("&nbsp;&nbsp;&nbsp;&nbsp;",$val['level']-1)?><?php echo $val['tennhom']?></option>
                        <?php } ?>
                    </select>
                </td>
            </tr>
            <tr>
            	<td><?php echo $this->document->text['khuvuc']?>:</td>
                <td>
                	<select id="khuvuc" name="khuvuc">
                        <option value=""></option>
                        <?php foreach($m_khuvuc as $val){ ?>
                        <option value="<?php echo $val['manhom']?>"><?php echo $this->string->getPrefix("&nbsp;&nbsp;&nbsp;&nbsp;",$val['level']-1)?><?php echo $val['tennhom']?></option>
                        <?php } ?>
                    </select>
                </td>
            </tr>
            <tr>
            	<td><?php echo $this->document->text['gia']?>:</td>
                <td>
                	<select id="mucgia" name="mucgia">
                        <option value=""></option>
                        <?php foreach($m_mucgia as $val){ ?>
                        <option value="<?php echo $val['manhom']?>"><?php echo $this->string->getPrefix("&nbsp;&nbsp;&nbsp;&nbsp;",$val['level']-1)?><?php echo $val['tennhom']?></option>
                        <?php } ?>
                    </select>
                </td>
            </tr>
            <tr>
            	<td><?php echo $this->document->text['huong']?>:</td>
                <td>
                	<select id="huong" name="huong">
                        <option value=""></option>
                        <?php foreach($m_huong as $val){ ?>
                        <option value="<?php echo $val['manhom']?>"><?php echo $this->string->getPrefix("&nbsp;&nbsp;&nbsp;&nbsp;",$val['level']-1)?><?php echo $val['tennhom']?></option>
                        <?php } ?>
                    </select>
                </td>
            </tr>
            <tr>
            	<td></td>
                <td>
                	<input type="button" class="ben-button" value="<?php echo $this->document->text['button_search']?>" onclick="searchForm()"/>
                </td>
            </tr>
        </table>
    </div>
    
    <div id="ben-header-player">
    	<embed id="player2" width="254" height="207" wmode="transparent" flashvars="file=<?php echo HTTP_SERVER.DIR_IMAGE?>videoplayback.flv&image=<?php echo HTTP_SERVER.DIR_IMAGE?>preview.png&provider=video" allowfullscreen="true" allowscriptaccess="always" src="<?php echo HTTP_SERVER.DIR_COMPONENT?>player/mediaplayer.swf" name="player2" type="application/x-shockwave-flash">
    </div>
    <embed width="1000" height="467" allowscriptaccess="always" wmode="transparent" loop="true" play="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="" src="<?php echo HTTP_SERVER.DIR_IMAGE?>DatLanh.swf">
</div>

<script language="javascript">
function searchForm()
{
	var url =  HTTP_SERVER+"site/<?php echo $this->member->getSiteId()?>/sangiaodich/search/";
	
	if($("#nhucau").val() != "")
		url += "[nhucau=" + $("#nhucau").val()+"]";
	if($("#loaibds").val() != "")
		url += "[loaibds="+ $("#loaibds").val()+"]";
	if($("#huong").val() != "")
		url += "[huong=" + $("#huong").val()+"]";
	if($("#khuvuc").val() != "")
		url += "[khuvuc=" + $("#khuvuc").val()+"]";
	if($("#mucgia").val() != "")
		url += "[mucgia=" + $("#mucgia").val()+"]";
	
	
	
	if("<?php echo $_GET['opendialog']?>" == "true")
	{
		url += "&opendialog=true";
	}
	
	window.location = url;
}


$("#nhucau").val("<?php echo $_GET['nhucau']?>");
$("#loaibds").val("<?php echo $_GET['loaibds']?>");
$("#huong").val("<?php echo $_GET['huong']?>");
$("#khuvuc").val("<?php echo $_GET['khuvuc']?>");
$("#mucgia").val("<?php echo $_GET['mucgia']?>");

</script>
